package com.project.entity.sys;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import com.project.entity.BaseEntity;

/**
 * 地区表
 * @author MG
 */
@Entity
@Table(name="S_AREA")
@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
@DynamicInsert
@DynamicUpdate
public class Area extends BaseEntity{

	private static final long serialVersionUID = 1L;
	
	@Column(name = "code", length = 30)
	private String code;//code
	
	@Column(name = "name", length = 20)
	private String name;//名称
	
	@Column(name = "parentcode", length = 30)
	private String parentcode;//父类code
	
	@Column
	private String status;// 状态（0:禁用;1:启用）
	
	@Column
	private String level;//级别
	
	@Column
	private String flag;//标识列(p:省,c:市,m:区)

	//子类集合
	@Transient
	private List<Area>  areaList = new ArrayList<Area>();
	
	@Transient
	private HashMap<String,Area> aityMap = new HashMap<String, Area>();

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getParentcode() {
		return parentcode;
	}

	public void setParentcode(String parentcode) {
		this.parentcode = parentcode;
	}

	public List<Area> getAreaList() {
		return areaList;
	}

	public void setAreaList(List<Area> areaList) {
		this.areaList = areaList;
	}

	public HashMap<String, Area> getAityMap() {
		return aityMap;
	}

	public void setAityMap(HashMap<String, Area> aityMap) {
		this.aityMap = aityMap;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
	}

	public String getFlag() {
		return flag;
	}

	public void setFlag(String flag) {
		this.flag = flag;
	}

	
}
